<?php
    if (!isset($user_id)) $user_id="";
    if (!isset($user_mobile)) $user_mobile="";
?>
<div class="row">
    <div class="col-xs-4">

        <input id="user_ser_id" placeholder="请输入会员ID，若不知道可以使用右侧输入会员绑定的手机号查询" name="[user-num-name]" type="number" class="form-control" value="{$user_id}" />
    </div>
    <div class="col-xs-4">
        <input placeholder="请输入完整会员手机号" type="text" id="user_sermobile" class="form-control" value="{$user_mobile}" />
    </div>
    <div class="col-xs-4">
        <button onclick="user_ser()" type="button" class="btn btn-success btn-block">点击查找</button>
    </div>

</div>

<script type="application/javascript">

    function user_ser(){
        var user_sermobile = $("#user_sermobile").val();
        if(user_sermobile==''){
            showErrorMessage('请先输入会员完整手机号，再点击查找');
            return false;
        }
        $.ajax({
            url: "{:url('Utils/queryUser')}",
            type: 'POST', //GET
            async: true,    //或false,是否异步
            data: {
                mobile: user_sermobile
            },
            timeout: 5000,    //超时时间
            dataType: 'html',    //返回的数据格式：json/xml/html/script/jsonp/text
            success: function (data) {

                if(data>0){
                    $("#user_ser_id").val(data);
                    showSuccessMessage('查询到会员ID为：'+data);
                }else{
                    showErrorMessage('未查询到会员');
                }
            }
        })
    }
</script>